<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of user
 *
 * @author agasi
 */
class Group extends CI_Controller {
    
    function __construct() 
    {
        parent::__construct();
        $this->load->helper('flexigrid');
        $this->load->model('menu_model');
//        $this->output->enable_profiler(TRUE);
    }
    
    function index()
    {
        //ver lib
		
        /*
        * 0 - display name
        * 1 - width
        * 2 - sortable
        * 3 - align
        * 4 - searchable (2 -> yes and default, 1 -> yes, 0 -> no.)
        */

        $col_model['grp_id'] = array('ID',40,TRUE,'center',0);
        $col_model['grp_nama'] = array('Nama',100,TRUE,'center',2);
        $col_model['grp_deskripsi'] = array('Deskripsi',200,TRUE,'center',1);
        $col_model['actions'] = array('Actions',50, FALSE, 'center',0);


        /*
        * Aditional Parameters
        */
        $grid_param= array(
        'width' => 700,
        'height' => 400,
        'rp' => 15,
        'rpOptions' => '[10,50]',
        'pagestat' => 'Displaying: {from} to {to} of {total} items.',
        'blockOpacity' => 0.5,
        'title' => 'User',
        'usepager'=> true,
        'useRp' => true,
        'showTableToggleBtn' => true,
        );

        /*
        * 0 - display name
        * 1 - bclass
        * 2 - onpress
        */
        
        $buttons[] = array('Add','add','test');
        $buttons[] = array('Delete','delete','test');
        $buttons[] = array('separator');
        $buttons[] = array('Select All','add','test');
        $buttons[] = array('DeSelect All','delete','test');
        $buttons[] = array('separator');


        //Build js
        //View helpers/flexigrid_helper.php for more information about the params on this function
        $grid_js = build_grid_js('flex1',site_url("/sistem/group_ajax"),$col_model,'user_id','asc',$grid_param,$buttons);

        $data['js_grid'] = $grid_js;
//        $data['menu'] = $this->menu_model->get_menu(1);
//		$data['version'] = "0.36";
//		$data['download_file'] = "Flexigrid_CI_v0.36.rar";
        //echo '<textarea>'.$grid_js.'</textarea>';
//		$this->load->view('header');
//                $this->load->view('sidebar',$data);
        $this->load->view('/sistem/group_view',$data);
    }
    
    function add()
    {
//        $test = "test";
//        $this->session->set_flashdata('item',$test);
        $data['menu'] = $this->menu_model->get_menu();
        $this->load->view('/sistem/group_add',$data);
    }
}

/* End of file group.php */
/* Location: ./application/controllers/sistem/group.php */